package de.lgohlke.compress;

import de.lgohlke.collection.SavedSpace;

/**
 * <p>ICompressor interface.</p>
 *
 * @author lars
 * @param <T>
 * @version $Id: $
 */
public interface ICompressor<T>
{
  /**
   * compress the value
   *
   * @param raw a T object.
   * @param <T> a T object.
   * @return a {@link de.lgohlke.compress.CompressableValue} object.
   */
  CompressableValue<T> compress(final T raw);

  /**
   * decompress the value
   *
   * @param compressed a {@link de.lgohlke.compress.CompressableValue} object.
   * @return a T object.
   */
  T decompress(final CompressableValue<T> compressed);

  /**
   * calculate the amount of space saved
   *
   * @param vo a {@link de.lgohlke.compress.CompressableValue} object.
   * @return a {@link de.lgohlke.collection.SavedSpace} object.
   */
  SavedSpace savedSpace(final CompressableValue<T> vo);
}
